package org.fujay.langchain4jserver.domain.model.vo;

import lombok.Getter;
import lombok.RequiredArgsConstructor;

import java.util.Arrays;

/**
 * 模型提供商枚举
 */
@Getter
@RequiredArgsConstructor
public enum ModelProvider {
    OPENAI("OpenAI"),
    AZURE_OPENAI("AzureOpenAI"),
    LOCAL("Local"), // 例如本地部署的 GGUF/Ollama 模型
    OTHER("Other"); // 其他自定义提供商

    private final String description;

    public static ModelProvider fromName(String name) {
        return Arrays.stream(ModelProvider.values())
                .filter(provider -> provider.name().equalsIgnoreCase(name))
                .findFirst()
                .orElseThrow(() -> new IllegalArgumentException("Unknown ModelProvider name: " + name));
    }
}
